package com.john.booter.list;

public class MyEntity {
	private int id;
	private String name;
	public MyEntity() {
	}
	public MyEntity(int id, String name) {
		super();
		this.id = id;
		this.name = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public boolean equals(Object otherObject) {
		
		// a quick test to see if the objects are identical  
        if (this == otherObject)  
            return true;  
  
        // must return false if the explicit parameter is null  
        if (otherObject == null)  
            return false;  
  
        // if the classed don't match,they can't be equal  
        if (getClass() != otherObject.getClass())  
            return false;  
  
        // now we know otherObject is a non-null Employee  
        MyEntity other = (MyEntity) otherObject;  
  
        // test whether the fields hava identical values  
        return id == other.getId();  
	}


}
